// NOTICE!!
// if it occurs error LNK2019 when using template
// 1. put the declaration together with the implement in the header file.
// 2. include both source file and header file when using it
#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdlib.h>
#include <time.h>

/* begin */
// swap two objects
template<typename T>
inline
void Swap(T &a, T &b) {
	T tmp = a;
	a = b;
	b = tmp;
}

/*
// another swap version using ^
template<typename T>
void swap(T &a, T &b) {
a = a^b;
b = a^b;
a = a^b;
}
*/

#endif